package com.lagou.service.impl;

import com.lagou.service.TestService;
import org.apache.dubbo.config.annotation.Service;

import java.util.Random;

@Service
public class TestServiceImpl implements TestService {

    @Override
    public String methodA() {
        System.out.println("执行方法A");
        return method();
    }

    @Override
    public String methodB() {
        System.out.println("执行方法B");
        return method();
    }

    @Override
    public String methodC() {
        System.out.println("执行方法C");
        return method();
    }

    public String method() {
        int i = new Random().nextInt(100);
        try {
            Thread.sleep(i);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "休眠了:"+i+"毫秒";
    }

}
